<script setup lang='ts'>
// 给 defineProps 添加类型标注 父向子传值
const prop = defineProps<{
  // modelValue: number
  count: number
}>()

const emit = defineEmits<{
  'update:count': [value: number | string]
}>()

const onChange = () => {
  // 通知父组件组件去修改 count的值
  emit('update:count', prop.count + 1)
}
</script>
<template>

  <div>
    {{ count }}
    <button @click="onChange">修改</button>
  </div>

</template>

<style scoped></style>